package com.ie.controller.before;

import com.ie.common.http.ResponseResult;
import com.ie.common.security.anno.AuthIgrone;
import com.ie.service.admin.AUserService;
import com.ie.service.before.BUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/api/before/")
public class BUserController {
    @Autowired
    private BUserService UserService;

    // 已有代码...

    @AuthIgrone
    @PostMapping("/changePassword")
    public ResponseResult<Map<String, String>> changePassword(@RequestBody Map<String, String> params) {
        String email = params.get("email");
        String oldPassword = params.get("oldPassword");
        String newPassword = params.get("newPassword");
        AUserService BUserService = null;
        return AUserService.changePassword(email, oldPassword, newPassword);
    }
}